﻿using System.Collections.Generic;
using System.Windows;
using Might.Infrastructure.ModelicaDOM;

namespace Might.Modelica.Annotations.Graphics {
    ///<summary>
    ///</summary>
    [Mapping("Point")]
    public class GraphicsPoint {
        internal Point p;

        ///<summary>
        ///</summary>
        public GraphicsPoint() {}

        ///<summary>
        ///</summary>
        ///<param name="x"></param>
        ///<param name="y"></param>
        public GraphicsPoint(double x, double y) {
            p.X = x;
            p.Y = y;
        }

        ///<summary>
        ///</summary>
        [ArrayIndexMapping(0), ConstructorIndexMapping(0)]
        public double X {
            get { return p.X; }
            set { p.X = value; }
        }

        ///<summary>
        ///</summary>
        [ArrayIndexMapping(1), ConstructorIndexMapping(1)]
        public double Y {
            get { return p.Y; }
            set { p.Y = value; }
        }

        [UnknownMapping]
        public List<object> UnknownItems { get; set; }

        public bool IsDefault {
            get { return p.X == 0 && p.Y == 0; }
        }

        public Point Point {
            get { return p; }
        }
    }
}